<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的收藏 - 外卖APP</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        body {
            margin: 0;
            padding: 0;
            background: #f5f5f5;
            font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
            color: #333;
        }
        .phone-container {
            width: 390px;
            height: 844px;
            margin: 20px auto;
            background: white;
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            border-radius: 40px;
        }
        .content {
            height: 100%;
            overflow-y: auto;
            background-color: #f8f9fa;
        }
        .header {
            background: #0095ff;
            color: white;
            padding: 16px;
            position: sticky;
            top: 0;
            z-index: 100;
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .back-btn {
            color: white;
            text-decoration: none;
            font-size: 20px;
            display: flex;
            align-items: center;
        }
        .header-title {
            font-size: 18px;
            font-weight: 600;
            margin: 0;
            flex-grow: 1;
            text-align: center;
            margin-right: 24px;
        }
        .favorite-tabs {
            background: white;
            display: flex;
            padding: 0 15px;
            border-bottom: 1px solid #f0f0f0;
            position: sticky;
            top: 56px;
            z-index: 99;
        }
        .favorite-tab {
            padding: 15px;
            font-size: 16px;
            font-weight: 600;
            color: #333;
        }
        .shop-list {
            padding: 15px;
        }
        .shop-item {
            background: white;
            border-radius: 12px;
            margin-bottom: 15px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.03);
            overflow: hidden;
            position: relative;
        }
        .shop-image {
            width: 100%;
            height: 150px;
            object-fit: cover;
        }
        .shop-info {
            padding: 15px;
        }
        .shop-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 10px;
        }
        .shop-name {
            font-size: 16px;
            font-weight: 600;
            margin: 0;
            flex: 1;
            margin-right: 10px;
        }
        .shop-rating {
            display: flex;
            align-items: center;
            gap: 5px;
            color: #ff9500;
            font-size: 13px;
        }
        .shop-rating i {
            font-size: 14px;
        }
        .shop-meta {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 10px;
            font-size: 13px;
            color: #666;
        }
        .shop-meta-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .shop-tags {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .shop-tag {
            background: rgba(0, 149, 255, 0.08);
            color: #0095ff;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 12px;
        }
        .shop-promotion {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #f5f5f5;
        }
        .promotion-item {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 13px;
            color: #ff6b6b;
            margin-bottom: 5px;
        }
        .promotion-item:last-child {
            margin-bottom: 0;
        }
        .promotion-item i {
            font-size: 14px;
        }
        .empty-state {
            text-align: center;
            padding: 40px 15px;
            color: #999;
        }
        .empty-state i {
            font-size: 48px;
            color: #ccc;
            margin-bottom: 15px;
        }
        .empty-text {
            font-size: 14px;
            margin-bottom: 20px;
        }
        .empty-btn {
            background: #0095ff;
            color: white;
            border: none;
            padding: 8px 24px;
            border-radius: 20px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .empty-btn:hover {
            background: #0085e5;
        }
        .unfavorite-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 32px;
            height: 32px;
            background: rgba(0, 0, 0, 0.5);
            border: none;
            border-radius: 50%;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            z-index: 10;
        }
        .unfavorite-btn i {
            font-size: 16px;
            color: white;
        }
        .unfavorite-btn:hover {
            background: rgba(0, 0, 0, 0.7);
            transform: scale(1.1);
        }
        .shop-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px solid #f5f5f5;
        }
        .enter-shop {
            background: #0095ff;
            color: white;
            border: none;
            padding: 6px 16px;
            border-radius: 15px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .enter-shop:hover {
            background: #0085e5;
        }
    </style>
</head>
<body>
    <div class="phone-container">
        <div class="content">
            <div class="header">
                <a href="user.html" class="back-btn">
                    <i class="bi bi-chevron-left"></i>
                </a>
                <h1 class="header-title">我的收藏</h1>
            </div>

            <div class="favorite-tabs">
                <div class="favorite-tab">收藏的商家(1)</div>
            </div>

            <div class="shop-list">
                <!-- 收藏的商家示例 -->
                <div class="shop-item">
                    <button class="unfavorite-btn">
                        <i class="bi bi-heart-fill"></i>
                    </button>
                    <img src="https://picsum.photos/400/200" alt="店铺图片" class="shop-image">
                    <div class="shop-info">
                        <div class="shop-header">
                            <h2 class="shop-name">川味小馆</h2>
                            <div class="shop-rating">
                                <i class="bi bi-star-fill"></i>
                                <span>4.8</span>
                            </div>
                        </div>
                        <div class="shop-meta">
                            <div class="shop-meta-item">
                                <i class="bi bi-clock"></i>
                                <span>30-40分钟</span>
                            </div>
                            <div class="shop-meta-item">
                                <i class="bi bi-bicycle"></i>
                                <span>配送费¥3</span>
                            </div>
                            <div class="shop-meta-item">
                                <i class="bi bi-shop"></i>
                                <span>月售2000+</span>
                            </div>
                        </div>
                        <div class="shop-tags">
                            <span class="shop-tag">川湘菜</span>
                            <span class="shop-tag">品质联盟</span>
                            <span class="shop-tag">准时达</span>
                        </div>
                        <div class="shop-promotion">
                            <div class="promotion-item">
                                <i class="bi bi-ticket-perforated"></i>
                                <span>新用户立减¥15</span>
                            </div>
                            <div class="promotion-item">
                                <i class="bi bi-currency-yen"></i>
                                <span>满¥50减¥10</span>
                            </div>
                        </div>
                        <div class="shop-actions">
                            <div class="shop-meta-item">
                                <i class="bi bi-geo-alt"></i>
                                <span>距离1.2km</span>
                            </div>
                            <button class="enter-shop">进入店铺</button>
                        </div>
                    </div>
                </div>

                <!-- 空状态（当没有收藏时显示） -->
                <div class="empty-state" style="display: none;">
                    <i class="bi bi-heart"></i>
                    <div class="empty-text">还没有收藏任何商家</div>
                    <button class="empty-btn">去逛逛</button>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 取消收藏功能
        document.querySelectorAll('.unfavorite-btn').forEach(btn => {
            btn.addEventListener('click', function(e) {
                e.preventDefault();
                if (confirm('确定取消收藏该商家吗？')) {
                    // 这里可以添加取消收藏的逻辑
                    this.closest('.shop-item').style.display = 'none';
                    // 如果没有其他商家了，显示空状态
                    if (document.querySelectorAll('.shop-item:not([style*="display: none"])').length === 0) {
                        document.querySelector('.empty-state').style.display = 'block';
                    }
                }
            });
        });
    </script>
</body>
</html> 